home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume89 / editors / stevie3a.4 < prev    next >
Text File  |  1989-03-15  |  43KB  |  1,469 lines

  1. Path: xanth!ukma!mailrus!ulowell!page
  2. From: page@swan.ulowell.edu (Bob Page)
  3. Newsgroups: comp.sources.amiga
  4. Subject: v89i043:  stevie - vi-like text editor v35a, Part04/06
  5. Message-ID: <12216@swan.ulowell.edu>
  6. Date: 15 Mar 89 15:11:59 GMT
  7. Organization: University of Lowell, Computer Science Dept.
  8. Lines: 1458
  9. Approved: page@swan.ulowell.edu
  10.  
  11. Submitted-by: grwalter@watcgl.waterloo.edu (Fred Walter)
  12. Posting-number: Volume 89, Issue 43
  13. Archive-name: editors/stevie35a.4
  14.  
  15. #    This is a shell archive.
  16. #    Remove everything above and including the cut line.
  17. #    Then run the rest of the file through sh.
  18. #----cut here-----cut here-----cut here-----cut here----#
  19. #!/bin/sh
  20. # shar:    Shell Archiver
  21. #    Run the following text with /bin/sh to create:
  22. #    cmdline.c
  23. #    regexp.cat.uu
  24. #    stevie.doc
  25. # This archive created: Tue Mar 14 14:42:06 1989
  26. cat << \SHAR_EOF > cmdline.c
  27. /*
  28.  * STEVIE - Simply Try this Editor for VI Enthusiasts
  29.  *
  30.  * Code Contributions By : Tim Thompson           twitch!tjt
  31.  *                         Tony Andrews           onecom!wldrdg!tony 
  32.  *                         G. R. (Fred) Walter    watmath!watcgl!grwalter 
  33.  */
  34.  
  35. #include "stevie.h"
  36.  
  37. static char    *altfile = NULL;    /* alternate file */
  38. static int      altline;    /* line # in alternate file */
  39.  
  40. static char    *nowrtmsg = "No write since last change (use ! to override)";
  41.  
  42. extern char   **files;        /* used for "n" and "rew" */
  43. extern int      curfile;
  44. extern int      numfiles;
  45.  
  46. /*
  47.  * The next two variables contain the bounds of any range given in a command.
  48.  * If no range was given, both contain null line pointers. If only a single
  49.  * line was given, u_pos will contain a null line pointer. 
  50.  */
  51. static LPtr     l_pos, u_pos;
  52.  
  53. static bool_t   interactive;    /* TRUE if we're reading a real command line */
  54.  
  55. static bool_t   doecmd();
  56. static void
  57. badcmd(), doshell(), get_range();
  58. static LPtr    *get_line();
  59.  
  60. #ifdef    MEGAMAX
  61. overlay "cmdline"
  62. #endif
  63.  
  64. /*
  65.  * readcmdline() - accept a command line starting with ':', '/', or '?' 
  66.  *
  67.  * readcmdline() accepts and processes colon commands and searches. If
  68.  * 'cmdline' is null, the command line is read here. Otherwise, cmdline
  69.  * points to a complete command line that should be used. This is used in
  70.  * main() to handle initialization commands in the environment variable
  71.  * "EXINIT". 
  72.  */
  73. void
  74. readcmdline(firstc, cmdline)
  75.     char            firstc;    /* either ':', '/', or '?' */
  76.     char           *cmdline;    /* optional command string */
  77. {
  78.     char            c;
  79.     char            buff[CMDBUFFSIZE];
  80.     char            cmdbuf[CMDBUFFSIZE];
  81.     char            argbuf[CMDBUFFSIZE];
  82.     char           *p, *q, *cmd, *arg;
  83.     bool_t          literal_next_flag = FALSE;
  84.  
  85.     /*
  86.      * Clear the range variables. 
  87.      */
  88.     l_pos.linep = (LINE *) NULL;
  89.     u_pos.linep = (LINE *) NULL;
  90.  
  91.     interactive = (cmdline == NULL);
  92.  
  93.     if (interactive)
  94.     gotocmdline(YES, firstc);
  95.     p = buff;
  96.     if (firstc != ':')
  97.     *p++ = firstc;
  98.  
  99.     if (interactive) {
  100.     /* collect the command string, handling '\b' and @ */
  101.     for (;;) {
  102.         c = vgetc();
  103.         if (c == CTRL('V') && !literal_next_flag) {
  104.         literal_next_flag = TRUE;
  105.         outchar('^');
  106.         continue;
  107.         }
  108.         if (c == '\n' || ((c == '\r' || c == ESC) && (!literal_next_flag)))
  109.         break;
  110.         if ((c == '\b') && (!literal_next_flag)) {
  111.         if (p > buff + (firstc != ':')) {
  112.             p--;
  113.             /*
  114.              * this is gross, but it relies only on 'gotocmdline' 
  115.              */
  116.             gotocmdline(YES, firstc == ':' ? ':' : NUL);
  117.             for (q = buff; q < p; q++)
  118.             outstr(chars[*q].ch_str);
  119.         } else {
  120.             msg("");
  121.             return;    /* back to cmd mode */
  122.         }
  123.         continue;
  124.         }
  125.         if ((c == '@') && (!literal_next_flag)) {
  126.         p = buff;
  127.         gotocmdline(YES, firstc);
  128.         continue;
  129.         }
  130.         if (literal_next_flag) {
  131.         literal_next_flag = FALSE;
  132.         outchar('\b');
  133.         }
  134.         outstr(chars[c].ch_str);
  135.         *p++ = c;
  136.     }
  137.     *p = '\0';
  138.     } else {
  139.     if (strlen(cmdline) > CMDBUFFSIZE - 2)    /* should really do something
  140.                          * better here... */
  141.         return;
  142.     strcpy(p, cmdline);
  143.     }
  144.  
  145.     /* skip any initial white space */
  146.     for (cmd = buff; *cmd != NUL && isspace(*cmd); cmd++);
  147.  
  148.     /* search commands */
  149.     c = *cmd;
  150.     if (c == '/' || c == '?') {
  151.     cmd++;
  152.     /* was the command was '//' or '??' (I.E. repeat last search) */
  153.     if ((*cmd == c) || (*cmd == NUL)) {
  154.         if (c == '/')
  155.         searchagain(FORWARD);
  156.         else
  157.         searchagain(BACKWARD);
  158.         return;
  159.     }
  160.     /* If there is a matching '/' or '?' at the end, toss it */
  161.     p = strchr(cmd, NUL);
  162.     if (*(p - 1) == c && *(p - 2) != '\\')
  163.         *(p - 1) = NUL;
  164.     dosearch((c == '/') ? FORWARD : BACKWARD, cmd);
  165.     return;
  166.     }
  167.     /*
  168.      * Parse a range, if present (and update the cmd pointer). 
  169.      */
  170.     get_range(&cmd);
  171.     if (l_pos.linep != NULL) {
  172.     if (LINEOF(&l_pos) > LINEOF(&u_pos)) {
  173.         emsg("Invalid range");
  174.         return;
  175.     }
  176.     }
  177.     strcpy(cmdbuf, cmd);    /* save the unmodified command */
  178.  
  179.     /* isolate the command and find any argument */
  180.     for (p = cmd; *p != NUL && !isspace(*p); p++);
  181.     if (*p == NUL)
  182.     arg = NULL;
  183.     else {
  184.     *p = NUL;
  185.     for (p++; *p != NUL && isspace(*p); p++);
  186.     if (*p == NUL) {
  187.         arg = NULL;
  188.     } else {
  189.         strcpy(argbuf, p);
  190.         arg = argbuf;
  191.     }
  192.     }
  193.  
  194.     if (strcmp(cmd, "q!") == 0)
  195.     getout(0);
  196.     if (strcmp(cmd, "q") == 0) {
  197.     if (Changed)
  198.         emsg(nowrtmsg);
  199.     else
  200.         getout(0);
  201.     return;
  202.     }
  203.     if (strcmp(cmd, "w") == 0) {
  204.     if (arg == NULL) {
  205.         if (Filename != NULL) {
  206.         writeit(Filename, &l_pos, &u_pos);
  207.         UNCHANGED;
  208.         } else
  209.         emsg("No output file");
  210.     } else
  211.         writeit(arg, &l_pos, &u_pos);
  212.     return;
  213.     }
  214.     if (strcmp(cmd, "wq") == 0) {
  215.     if (Filename != NULL) {
  216.         if (writeit(Filename, (LPtr *) NULL, (LPtr *) NULL))
  217.         getout(0);
  218.     } else
  219.         emsg("No output file");
  220.     return;
  221.     }
  222.     if (strcmp(cmd, "x") == 0) {
  223.     if (Changed) {
  224.         if (Filename != NULL) {
  225.         if (!writeit(Filename, (LPtr *) NULL, (LPtr *) NULL))
  226.             return;
  227.         } else {
  228.         emsg("No output file");
  229.         return;
  230.         }
  231.     }
  232.     getout(0);
  233.     }
  234.     if (strcmp(cmd, "f") == 0 && arg == NULL) {
  235.     fileinfo();
  236.     return;
  237.     }
  238.     if (*cmd == 'n') {
  239.     if ((curfile + 1) < numfiles) {
  240.         /*
  241.          * stuff ":e[!] FILE\n" 
  242.          */
  243.         stuffReadbuff(":e");
  244.         if (cmd[1] == '!')
  245.         stuffReadbuff("!");
  246.         stuffReadbuff(" ");
  247.         stuffReadbuff(files[++curfile]);
  248.         stuffReadbuff("\n");
  249.     } else
  250.         emsg("No more files!");
  251.     return;
  252.     }
  253.     if (*cmd == 'p') {
  254.     if (curfile > 0) {
  255.         /*
  256.          * stuff ":e[!] FILE\n" 
  257.          */
  258.         stuffReadbuff(":e");
  259.         if (cmd[1] == '!')
  260.         stuffReadbuff("!");
  261.         stuffReadbuff(" ");
  262.         stuffReadbuff(files[--curfile]);
  263.         stuffReadbuff("\n");
  264.     } else
  265.         emsg("No more files!");
  266.     return;
  267.     }
  268.     if (strncmp(cmd, "rew", 3) == 0) {
  269.     if (numfiles <= 1)    /* nothing to rewind */
  270.         return;
  271.     curfile = 0;
  272.     /*
  273.      * stuff ":e[!] FILE\n" 
  274.      */
  275.     stuffReadbuff(":e");
  276.     if (cmd[3] == '!')
  277.         stuffReadbuff("!");
  278.     stuffReadbuff(" ");
  279.     stuffReadbuff(files[0]);
  280.     stuffReadbuff("\n");
  281.     return;
  282.     }
  283.     if (strcmp(cmd, "e") == 0 || strcmp(cmd, "e!") == 0) {
  284.     doecmd(arg, cmd[1] == '!');
  285.     return;
  286.     }
  287.     if (strcmp(cmd, "f") == 0) {
  288.     Filename = strsave(arg);
  289.     filemess("");
  290.     return;
  291.     }
  292.     if (strcmp(cmd, "r") == 0 || strcmp(cmd, ".r") == 0) {
  293.     if (arg == NULL) {
  294.         badcmd();
  295.         return;
  296.     }
  297.     if (readfile(arg, Curschar, 1)) {
  298.         emsg("Can't open file");
  299.         return;
  300.     }
  301.     updateNextscreen(NOT_VALID);
  302.     CHANGED;
  303.     return;
  304.     }
  305.     if (strcmp(cmd, ".=") == 0) {
  306.     smsg("line %d", cntllines(Filemem, Curschar));
  307.     return;
  308.     }
  309.     if (strcmp(cmd, "$=") == 0) {
  310.     smsg("%d", cntllines(Filemem, Fileend) - 1);
  311.     return;
  312.     }
  313.     if (strncmp(cmd, "ta", 2) == 0) {
  314.     dotag(arg, cmd[2] == '!');
  315.     return;
  316.     }
  317.     if (strcmp(cmd, "set") == 0) {
  318.     doset(arg, interactive);
  319.     return;
  320.     }
  321.     if (strcmp(cmd, "help") == 0) {
  322.     if (help()) {
  323.         screenclear();
  324.         updateNextscreen(NOT_VALID);
  325.     }
  326.     return;
  327.     }
  328.     if (strcmp(cmd, "version") == 0) {
  329.     extern char    *Version;
  330.  
  331.     msg(Version);
  332.     return;
  333.     }
  334.     if (strcmp(cmd, "sh") == 0) {
  335.     doshell();
  336.     return;
  337.     }
  338.     if (strncmp(cmd, "d", 1) == 0) {
  339.     LINE           *cp;
  340.     int             n;
  341.  
  342.     if (l_pos.linep == NULL)
  343.         l_pos = *Curschar;
  344.     if (u_pos.linep == NULL)
  345.         u_pos = l_pos;
  346.  
  347.     ResetBuffers();
  348.     n = RowNumber(&l_pos);
  349.     AppendPositionToUndoUndobuff(0, n);
  350.     AppendPositionToUndobuff(0, n);
  351.     if ((Filetop->linep->next == l_pos.linep) &&
  352.         (u_pos.linep->next == Fileend->linep))
  353.         AppendToUndobuff("a");
  354.     else if (u_pos.linep->next == Fileend->linep)
  355.         AppendToUndobuff("o");
  356.     else
  357.         AppendToUndobuff("O");
  358.  
  359.     n = 0;
  360.     cp = l_pos.linep;
  361.     for (; cp != NULL && cp != Fileend->linep; cp = cp->next) {
  362.         AppendToUndobuff(cp->s);
  363.         n++;
  364.         if (cp == u_pos.linep)
  365.         break;
  366.         AppendToUndobuff(NL_STR);
  367.     }
  368.     AppendToUndobuff(ESC_STR);
  369.  
  370.     if (n > 1)
  371.         AppendNumberToUndoUndobuff(n);
  372.     AppendToUndoUndobuff("dd");
  373.  
  374.     *Curschar = l_pos;
  375.     delline(n, FALSE);
  376.     updateNextscreen(NOT_VALID);
  377.     MustRedrawScreen = TRUE;/* Shouldn't have to do this. */
  378.     return;
  379.     }
  380.     if (strncmp(cmd, "s/", 2) == 0) {
  381.     dosub(&l_pos, &u_pos, cmdbuf + 1);
  382.     return;
  383.     }
  384.     if (strncmp(cmd, "g/", 2) == 0) {
  385.     doglob(&l_pos, &u_pos, cmdbuf + 1);
  386.     return;
  387.     }
  388.     /*
  389.      * If we got a line, but no command, then go to the line. 
  390.      */
  391.     if (*cmd == NUL && l_pos.linep != NULL) {
  392.     if (u_pos.linep != NULL)
  393.         *Curschar = u_pos;
  394.     else
  395.         *Curschar = l_pos;
  396.     cursupdate();
  397.     return;
  398.     }
  399.     badcmd();
  400. }
  401.  
  402. /*
  403.  * get_range - parse a range specifier 
  404.  *
  405.  * Ranges are of the form: 
  406.  *
  407.  * addr[,addr] 
  408.  *
  409.  * where 'addr' is: 
  410.  *
  411.  * %          (entire file)
  412.  * $  [+-NUM]
  413.  * 'x [+-NUM] (where x denotes a currently defined mark)
  414.  * .  [+-NUM]
  415.  * NUM 
  416.  *
  417.  * The pointer *cp is updated to point to the first character following the
  418.  * range spec. If an initial address is found, but no second, the upper bound
  419.  * is equal to the lower. 
  420.  */
  421. static void
  422. get_range(cp)
  423.     char          **cp;
  424. {
  425.     LPtr           *l;
  426.     char           *p;
  427.  
  428.     if (**cp == '%') {
  429.     l_pos.index = 0;
  430.     l_pos.linep = Filetop->linep->next;
  431.     u_pos.index = 0;
  432.     u_pos.linep = Fileend->linep->prev;
  433.     (*cp)++;
  434.     return;
  435.     }
  436.     if ((l = get_line(cp)) == NULL)
  437.     return;
  438.  
  439.     l_pos = *l;
  440.  
  441.     for (p = *cp; *p != NUL && isspace(*p); p++);
  442.  
  443.     *cp = p;
  444.  
  445.     if (*p != ',') {        /* is there another line spec ? */
  446.     u_pos = l_pos;
  447.     return;
  448.     }
  449.     *cp = ++p;
  450.  
  451.     if ((l = get_line(cp)) == NULL) {
  452.     u_pos = l_pos;
  453.     return;
  454.     }
  455.     u_pos = *l;
  456. }
  457.  
  458. static LPtr    *
  459. get_line(cp)
  460.     char          **cp;
  461. {
  462.     static LPtr     pos;
  463.     LPtr           *lp;
  464.     char           *p, c;
  465.     int             lnum;
  466.  
  467.     pos.index = 0;        /* shouldn't matter... check back later */
  468.  
  469.     p = *cp;
  470.     /*
  471.      * Determine the basic form, if present. 
  472.      */
  473.     switch (c = *p++) {
  474.  
  475.       case '$':
  476.     pos.linep = Fileend->linep->prev;
  477.     break;
  478.  
  479.       case '.':
  480.     pos.linep = Curschar->linep;
  481.     break;
  482.  
  483.       case '\'':
  484.     if ((lp = getmark(*p++)) == NULL) {
  485.         emsg("Unknown mark");
  486.         return (LPtr *) NULL;
  487.     }
  488.     pos = *lp;
  489.     break;
  490.  
  491.       case '0':
  492.       case '1':
  493.       case '2':
  494.       case '3':
  495.       case '4':
  496.       case '5':
  497.       case '6':
  498.       case '7':
  499.       case '8':
  500.       case '9':
  501.     for (lnum = c - '0'; isdigit(*p); p++)
  502.         lnum = (lnum * 10) + (*p - '0');
  503.  
  504.     if (lnum == 0)
  505.         lnum = 1;
  506.  
  507.     pos = *gotoline(lnum);
  508.     break;
  509.  
  510.       default:
  511.     return (LPtr *) NULL;
  512.     }
  513.  
  514.     while (*p != NUL && isspace(*p))
  515.     p++;
  516.  
  517.     if (*p == '-' || *p == '+') {
  518.     bool_t          neg = (*p++ == '-');
  519.  
  520.     for (lnum = 0; isdigit(*p); p++)
  521.         lnum = (lnum * 10) + (*p - '0');
  522.  
  523.     if (neg)
  524.         lnum = -lnum;
  525.  
  526.     pos = *gotoline(cntllines(Filemem, &pos) + lnum);
  527.     }
  528.     *cp = p;
  529.     return &pos;
  530. }
  531.  
  532. static void
  533. badcmd()
  534. {
  535.     if (interactive)
  536.     emsg("Unrecognized command");
  537. }
  538.  
  539. /*
  540.  * dotag(tag, force) - goto tag 
  541.  */
  542. void
  543. dotag(tag, force)
  544.     char           *tag;
  545.     bool_t          force;
  546. {
  547.     FILE           *tp, *fopen();
  548.     char            lbuf[LSIZE];
  549.     char           *fname, *str;
  550.  
  551.     if ((tp = fopen("tags", "r")) == NULL) {
  552.     emsg("Can't open tags file");
  553.     return;
  554.     }
  555.     while (fgets(lbuf, LSIZE, tp) != NULL) {
  556.  
  557.     if ((fname = strchr(lbuf, TAB)) == NULL) {
  558.         emsg("Format error in tags file");
  559.         return;
  560.     }
  561.     *fname++ = '\0';
  562.     if ((str = strchr(fname, TAB)) == NULL) {
  563.         emsg("Format error in tags file");
  564.         return;
  565.     }
  566.     *str++ = '\0';
  567.  
  568.     if (strcmp(lbuf, tag) == 0) {
  569.         if (!force && Changed) {
  570.         emsg(nowrtmsg);
  571.         return;
  572.         }
  573.         if (doecmd(fname, force)) {
  574.         stuffReadbuff(str);    /* str has \n at end */
  575.         stuffReadbuff("\007");    /* CTRL('G') */
  576.         fclose(tp);
  577.         return;
  578.         }
  579.     }
  580.     }
  581.     emsg("tag not found");
  582.     fclose(tp);
  583. }
  584.  
  585. static          bool_t
  586. doecmd(arg, force)
  587.     char           *arg;
  588.     bool_t          force;
  589. {
  590.     int             line = 1;    /* line # to go to in new file */
  591.  
  592.     if (!force && Changed) {
  593.     emsg(nowrtmsg);
  594.     return FALSE;
  595.     }
  596.     if (arg != NULL) {
  597.     /*
  598.      * First detect a ":e" on the current file. This is mainly for ":ta"
  599.      * commands where the destination is within the current file. 
  600.      */
  601.     if (Filename != NULL && strcmp(arg, Filename) == 0) {
  602.         if (!Changed || (Changed && !force))
  603.         return TRUE;
  604.     }
  605.     if (strcmp(arg, "#") == 0) {    /* alternate */
  606.         char           *s = Filename;
  607.  
  608.         if (altfile == NULL) {
  609.         emsg("No alternate file");
  610.         return FALSE;
  611.         }
  612.         Filename = altfile;
  613.         altfile = s;
  614.         line = altline;
  615.         altline = cntllines(Filemem, Curschar);
  616.     } else {
  617.         altfile = Filename;
  618.         altline = cntllines(Filemem, Curschar);
  619.         Filename = strsave(arg);
  620.     }
  621.     }
  622.     if (Filename == NULL) {
  623.     emsg("No filename");
  624.     return FALSE;
  625.     }
  626.     /* clear mem and read file */
  627.     freeall();
  628.     filealloc();
  629.     UNCHANGED;
  630.  
  631.     readfile(Filename, Filemem, 0);
  632.     *Topchar = *Curschar;
  633.     if (line != 1) {
  634.     stuffnumReadbuff(line);
  635.     stuffReadbuff("G");
  636.     }
  637.     setpcmark();
  638.     updateNextscreen(NOT_VALID);
  639.     return TRUE;
  640. }
  641.  
  642. static void
  643. doshell()
  644. {
  645.     char           *sh, *getenv();
  646.  
  647.     sh = getenv("SHELL");
  648.     if (sh == NULL) {
  649.     emsg("Shell variable not set");
  650.     return;
  651.     }
  652.     gotocmdline(YES, NUL);
  653.  
  654.     if (system(sh) < 0) {
  655.     emsg("Exec failed");
  656.     return;
  657.     }
  658.     wait_return();
  659. }
  660.  
  661. void
  662. gotocmdline(clr, firstc)
  663.     bool_t          clr;
  664.     char            firstc;
  665. {
  666.     windgoto(Rows - 1, 0);
  667.     if (clr)
  668.     outstr(T_EL);        /* clear the bottom line */
  669.     if (firstc)
  670.     outchar(firstc);
  671. }
  672.  
  673. /*
  674.  * msg(s) - displays the string 's' on the status line 
  675.  */
  676. void
  677. msg(s)
  678.     char           *s;
  679. {
  680.     gotocmdline(YES, NUL);
  681.     outstr(s);
  682. #ifdef AMIGA
  683.     flushbuf();
  684. #endif
  685. #ifdef BSD
  686.     fflush(stdout);
  687. #endif
  688. }
  689.  
  690. /* VARARGS */
  691. void
  692. smsg(s, a1, a2, a3, a4, a5, a6, a7, a8, a9)
  693.     char           *s;
  694.     int             a1, a2, a3, a4, a5, a6, a7, a8, a9;
  695. {
  696.     char            sbuf[MAX_COLUMNS + 1];
  697.  
  698.     sprintf(sbuf, s, a1, a2, a3, a4, a5, a6, a7, a8, a9);
  699.     msg(sbuf);
  700. }
  701.  
  702. /*
  703.  * emsg() - display an error message 
  704.  *
  705.  * Rings the bell, if appropriate, and calls message() to do the real work 
  706.  */
  707. void
  708. emsg(s)
  709.     char           *s;
  710. {
  711.     UndoInProgress = FALSE;
  712.     RedrawingDisabled = FALSE;
  713.  
  714.     if (P(P_EB))
  715.     beep();
  716.     outstr(T_TI);
  717.     msg(s);
  718.     outstr(T_TP);
  719. #ifdef AMIGA
  720.     flushbuf();
  721. #endif
  722. #ifdef BSD
  723.     fflush(stdout);
  724. #endif
  725. }
  726.  
  727. void
  728. wait_return()
  729. {
  730.     char            c;
  731.  
  732.     outstr("Press RETURN to continue");
  733.     do {
  734.     c = vgetc();
  735.     } while (c != '\r' && c != '\n');
  736.  
  737.     screenclear();
  738.     updateNextscreen(NOT_VALID);
  739. }
  740. SHAR_EOF
  741. cat << \SHAR_EOF > regexp.cat.uu
  742.  
  743. begin 644 regexp.cat
  744. M"@H*"E)%1T584"@S*2`@("`@("`@("`@("`@("!,:6)R87)Y($9U;F-T:6]NR
  745. M<R`@("`@("`@("`@("`@(%)%1T584"@S*0H*"@I."$Y!"$%-"$U%"$4*("`@6
  746. M("!R96=C;VUP+"!R96=E>&5C+"!R96=S=6(L(')E9V5R<F]R("T@<F5G=6QA1
  747. M<B!E>'!R97-S:6]N"B`@("`@:&%N9&QE<@H*4PA360A93@A.3PA/4`A04PA3&
  748. M20A)4PA3"B`@("`@(P@C:0AI;@AN8PAC;`AL=0AU9`AD90AE(#P(/'((<F4(Y
  749. M96<(9V4(97@(>'`(<"X(+F@(:#X(/@H*("`@("!R"')E"&5G"&=E"&5X"'APO
  750. M"'`@*@@J<@AR90AE9PAG8PAC;PAO;0AM<`AP*`@H90AE>`AX<`AP*0@I"B`@T
  751. M("`@8PAC:`AH80AA<@AR("H(*F4(97@(>'`(<#L(.PH*("`@("!I"&EN"&YT.
  752. M"'0@<@AR90AE9PAG90AE>`AX90AE8PAC*`@H<`AP<@AR;PAO9PAG+`@L(',(]
  753. M<W0(='((<FD(:6X(;F<(9RD(*0H@("`@('((<F4(96<(9V4(97@(>'`(<"`JW
  754. M""IP"'!R"')O"&]G"&<["#L*("`@("!C"&-H"&AA"&%R"'(@*@@J<PAS=`AT@
  755. M<@AR:0AI;@AN9PAG.P@["@H@("`@('((<F4(96<(9W,(<W4(=6((8B@(*'`("
  756. M<'((<F\(;V<(9RP(+"!S"'-O"&]U"'5R"')C"&-E"&4L""P@9`AD90AE<PASZ
  757. M=`AT*0@I"B`@("`@<@AR90AE9PAG90AE>`AX<`AP("H(*G`(<'((<F\(;V<(?
  758. M9SL(.PH@("`@(&,(8V@(:&$(87((<B`J""IS"'-O"&]U"'5R"')C"&-E"&4[T
  759. M"#L*("`@("!C"&-H"&AA"&%R"'(@*@@J9`AD90AE<PAS=`AT.P@["@H@("`@7
  760. M('((<F4(96<(9V4(97((<G((<F\(;W((<B@(*&T(;7,(<V<(9RD(*0H@("`@2
  761. M(&,(8V@(:&$(87((<B`J""IM"&US"'-G"&<["#L*"D0(1$4(15,(4T,(0U((H
  762. M4DD(25`(4%0(5$D(24\(3TX(3@H@("`@(%1H97-E(&9U;F-T:6]N<R!I;7!L6
  763. M96UE;G0*("`@("!?"&5?"&=?"')?"&5?"'`H,2DM<W1Y;&4*("`@("!R96=U6
  764. M;&%R(&5X<')E<W-I;VYS(&%N9"!S=7!P;W)T:6YG(&9A8VEL:71I97,N"@H@/
  765. M("`@(%\(4E\(95\(9U\(8U\(;U\(;5\(<`H@("`@(&-O;7!I;&5S(&$@<F5G#
  766. M=6QA<B!E>'!R97-S:6]N(&EN=&\@82!S=')U8W1U<F4@;V8@='EP90H@("`@Q
  767. M(%\(<E\(95\(9U\(95\(>%\(<"P*("`@("!A;F0@<F5T=7)N<R!A('!O:6YT<
  768. M97(@=&\@:70N"B`@("`@5&AE('-P86-E(&AA<R!B965N(&%L;&]C871E9"!UP
  769. M<VEN9PH@("`@(%\(;5\(85\(;%\(;%\(;U\(8R@S*0H@("`@(&%N9"!M87D@E
  770. M8F4@<F5L96%S960@8GD*("`@("!?"&9?"')?"&5?"&4N"@H@("`@(%\(4E\(1
  771. M95\(9U\(95\(>%\(95\(8PH@("`@(&UA=&-H97,@82!.54PM=&5R;6EN871E)
  772. M9"!?"'-?"'1?"')?"&E?"&Y?"&<@86=A:6YS="!T:&4@8V]M<&EL960@<F5GX
  773. M=6QA<B!E>'!R97-S:6]N"B`@("`@:6X@7PAP7PAR7PAO7PAG+@H@("`@($ETN
  774. M(')E='5R;G,@,2!F;W(@<W5C8V5S<R!A;F0@,"!F;W(@9F%I;'5R92P@86YD5
  775. M(&%D:G5S=',@=&AE(&-O;G1E;G1S(&]F"B`@("`@7PAP7PAR7PAO7PAG)W,@Z
  776. M7PAS7PAT7PAA7PAR7PAT7PAP(&%N9"!?"&5?"&Y?"&1?"'`@*'-E92!B96QO%
  777. M=RD@86-C;W)D:6YG;'DN"@H@("`@(%1H92!M96UB97)S(&]F(&$*("`@("!?<
  778. M"')?"&5?"&=?"&5?"'A?"'`*("`@("!S=')U8W1U<F4@:6YC;'5D92!A="!LV
  779. M96%S="!T:&4@9F]L;&]W:6YG("AN;W0@;F5C97-S87)I;'D@:6X@;W)D97(IV
  780. M.@H*("`@("`@("`@(&-H87(@*G-T87)T<%M.4U5"15A073L*("`@("`@("`@6
  781. M(&-H87(@*F5N9'!;3E-50D584%T["@H@("`@('=H97)E"B`@("`@7PA.7PA3O
  782. M7PA57PA"7PA%7PA87PA0"B`@("`@:7,@9&5F:6YE9"`H87,@,3`I(&EN('1HU
  783. M92!H96%D97(@9FEL92X*"@H*1F]R;6%T=&5D(#@X+S$R+S,P("`@("`@("`@^
  784. M("`@;&]C86P@("`@("`@("`@("`@("`@("`@("`@("`@("`@(#$*#`H*"@I2,
  785. M14=%6%`H,RD@("`@("`@("`@("`@("`@3&EB<F%R>2!&=6YC=&EO;G,@("`@K
  786. M("`@("`@("`@("!214=%6%`H,RD*"@H*("`@("!/;F-E(&$@<W5C8V5S<V9UQ
  787. M;"!?"')?"&5?"&=?"&5?"'A?"&5?"&,@:&%S(&)E96X@9&]N92!U<VEN9R!TV
  788. M:&4@7PAR7PAE7PAG7PAE7PAX7PAP+`H@("`@(&5A8V@@7PAS7PAT7PAA7PAR_
  789. M7PAT7PAP+5\(95\(;E\(9%\(<"!P86ER(&1E<V-R:6)E<R!O;F4@<W5B<W1RG
  790. M:6YG"B`@("`@=VET:&EN('1H92!?"'-?"'1?"')?"&E?"&Y?"&<L"B`@("`@3
  791. M=VET:"!T:&4@7PAS7PAT7PAA7PAR7PAT7PAP('!O:6YT:6YG('1O('1H92!FW
  792. M:7)S="!C:&%R86-T97(@;V8@=&AE('-U8G-T<FEN9R!A;F0*("`@("!T:&4@$
  793. M7PAE7PAN7PAD7PAP('!O:6YT:6YG('1O('1H92!F:7)S="!C:&%R86-T97(@D
  794. M9F]L;&]W:6YG('1H92!S=6)S=')I;F<N"B`@("`@5&AE(#!T:"!S=6)S=')I$
  795. M;F<@:7,@=&AE('-U8G-T<FEN9R!O9B!?"'-?"'1?"')?"&E?"&Y?"&<@=&AAF
  796. M="!M871C:&5D('1H92!W:&]L90H@("`@(')E9W5L87(@97AP<F5S<VEO;BX*.
  797. M("`@("!4:&4@;W1H97)S(&%R92!T:&]S92!S=6)S=')I;F=S('1H870@;6%TX
  798. M8VAE9"!P87)E;G1H97-I>F5D(&5X<')E<W-I;VYS"B`@("`@=VET:&EN('1H&
  799. M92!R96=U;&%R(&5X<')E<W-I;VXL('=I=&@@<&%R96YT:&5S:7IE9"!E>'!RD
  800. M97-S:6]N<R!N=6UB97)E9`H@("`@(&EN(&QE9G0M=&\M<FEG:'0@;W)D97(@Y
  801. M;V8@=&AE:7(@;W!E;FEN9R!P87)E;G1H97-E<RX*"B`@("`@7PA27PAE7PAG8
  802. M7PAS7PAU7PAB"B`@("`@8V]P:65S(%\(<U\(;U\(=5\(<E\(8U\(92!T;R!?)
  803. M"&1?"&5?"'-?"'0L(&UA:VEN9R!S=6)S=&ET=71I;VYS(&%C8V]R9&EN9R!T>
  804. M;R!T:&4*("`@("!M;W-T(')E8V5N="!?"')?"&5?"&=?"&5?"'A?"&5?"&,@2
  805. M<&5R9F]R;65D('5S:6YG(%\(<%\(<E\(;U\(9RX*("`@("!%86-H(&EN<W1A&
  806. M;F-E(&]F(&`F)R!I;B!?"'-?"&]?"'5?"')?"&-?"&4@:7,@<F5P;&%C960@&
  807. M8GD@=&AE('-U8G-T<FEN9PH@("`@(&EN9&EC871E9"!B>2!?"'-?"'1?"&%?#
  808. M"')?"'1?"'!;7P@P72!A;F0*("`@("!?"&5?"&Y?"&1?"'!;7P@P72X*("`@B
  809. M("!%86-H(&EN<W1A;F-E(&]F(&!<7PAN)RP@=VAE<F4@7PAN(&ES(&$@9&EG@
  810. M:70L(&ES(')E<&QA8V5D(&)Y"B`@("`@=&AE('-U8G-T<FEN9R!I;F1I8V%T(
  811. M960@8GD*("`@("!?"'-?"'1?"&%?"')?"'1?"'!;7PAN72!A;F0*("`@("!??
  812. M"&5?"&Y?"&1?"'!;7PAN72X*("`@("!4;R!G970@82!L:71E<F%L(&`F)R!O6
  813. M<B!@7%\(;B<@:6YT;R!?"&1?"&5?"'-?"'0L('!R969I>"!I="!W:71H(&!<?
  814. M)SL*("`@("!T;R!G970@82!L:71E<F%L(&!<)R!P<F5C961I;F<@8"8G(&]R_
  815. M(&!<7PAN)RP@<')E9FEX(&ET('=I=&@*("`@("!A;F]T:&5R(&!<)RX*"B`@K
  816. M("`@7PA27PAE7PAG7PAE7PAR7PAR7PAO7PAR"B`@("`@:7,@8V%L;&5D('=HJ
  817. M96YE=F5R(&%N(&5R<F]R(&ES(&1E=&5C=&5D(&EN(%\(<E\(95\(9U\(8U\(7
  818. M;U\(;5\(<"P@7PAR7PAE7PAG7PAE7PAX7PAE7PAC+`H@("`@(&]R(%\(<E\(Q
  819. M95\(9U\(<U\(=5\(8BX*("`@("!4:&4@9&5F875L="!?"')?"&5?"&=?"&5?N
  820. M"')?"')?"&]?"'(@=W)I=&5S('1H92!S=')I;F<@7PAM7PAS7PAG+`H@("`@J
  821. M('=I=&@@82!S=6ET86)L92!I;F1I8V%T;W(@;V8@;W)I9VEN+`H@("`@(&]N#
  822. M('1H92!S=&%N9&%R9`H@("`@(&5R<F]R(&]U='!U=`H@("`@(&%N9"!I;G9OP
  823. M:V5S(%\(95\(>%\(:5\(="@R*2X*("`@("!?"%)?"&5?"&=?"&5?"')?"')?$
  824. M"&]?"'(*("`@("!C86X@8F4@<F5P;&%C960@8GD@=&AE('5S97(@:68@;W1H(
  825. M97(@86-T:6]N<R!A<F4@9&5S:7)A8FQE+@H*4@A210A%1PA'50A53`A,00A!]
  826. M4@A2($4(15@(6%`(4%((4D4(15,(4U,(4TD(24\(3TX(3B!3"%-9"%E."$Y4\
  827. M"%1!"$%8"%@*("`@("!!(')E9W5L87(@97AP<F5S<VEO;B!I<R!Z97)O(&]RH
  828. M(&UO<F4@7PAB7PAR7PAA7PAN7PAC7PAH7PAE7PAS+"!S97!A<F%T960@8GD@1
  829. M8'PG+@H@("`@($ET(&UA=&-H97,@86YY=&AI;F<@=&AA="!M871C:&5S(&]NR
  830. M92!O9B!T:&4@8G)A;F-H97,N"@H@("`@($$@8G)A;F-H(&ES('IE<F\@;W(@/
  831. M;6]R92!?"'!?"&E?"&5?"&-?"&5?"',L(&-O;F-A=&5N871E9"X*("`@("!),
  832. M="!M871C:&5S(&$@;6%T8V@@9F]R('1H92!F:7)S="P@9F]L;&]W960@8GD@Z
  833. M82!M871C:"!F;W(@=&AE('-E8V]N9"P@971C+@H*("`@("!!('!I96-E(&ES_
  834. M(&%N(%\(85\(=%\(;U\(;2!P;W-S:6)L>2!F;VQL;W=E9"!B>2!@*B<L(&`K0
  835. M)RP@;W(@8#\G+@H@("`@($%N(&%T;VT@9F]L;&]W960@8GD@8"HG(&UA=&-H'
  836. M97,@82!S97%U96YC92!O9B`P(&]R(&UO<F4@;6%T8VAE<R!O9B!T:&4@871OJ
  837. M;2X*("`@("!!;B!A=&]M(&9O;&QO=V5D(&)Y(&`K)R!M871C:&5S(&$@<V5Q]
  838. M=65N8V4@;V8@,2!O<B!M;W)E(&UA=&-H97,@;V8@=&AE(&%T;VTN"B`@("`@N
  839. M06X@871O;2!F;VQL;W=E9"!B>2!@/R<@;6%T8VAE<R!A(&UA=&-H(&]F('1H!
  840. M92!A=&]M+"!O<B!T:&4@;G5L;"!S=')I;F<N"@H@("`@($%N(&%T;VT@:7,@4
  841. M82!R96=U;&%R(&5X<')E<W-I;VX@:6X@<&%R96YT:&5S97,@*&UA=&-H:6YGO
  842. M(&$@;6%T8V@@9F]R('1H90H@("`@(')E9W5L87(@97AP<F5S<VEO;BDL(&$@X
  843. M7PAR7PAA7PAN7PAG7PAE("AS964@8F5L;W<I+"!@+B<*("`@("`H;6%T8VAI`
  844. M;F<@86YY('-I;F=L92!C:&%R86-T97(I+"!@7B<@*&UA=&-H:6YG('1H92!N(
  845. M=6QL('-T<FEN9R!A="!T:&4*("`@("!B96=I;FYI;F<@;V8@=&AE(&EN<'5T;
  846. M('-T<FEN9RDL(&`D)R`H;6%T8VAI;F<@=&AE(&YU;&P@<W1R:6YG(&%T('1H.
  847. M90H*"@I&;W)M871T960@.#@O,3(O,S`@("`@("`@("`@("!L;V-A;"`@("`@2
  848. M("`@("`@("`@("`@("`@("`@("`@("`@,@H,"@H*"E)%1T584"@S*2`@("`@?
  849. M("`@("`@("`@("!,:6)R87)Y($9U;F-T:6]N<R`@("`@("`@("`@("`@(%)%%
  850. M1T584"@S*0H*"@H@("`@(&5N9"!O9B!T:&4@:6YP=70@<W1R:6YG*2P@82!@J
  851. M7"<@9F]L;&]W960@8GD@82!S:6YG;&4@8VAA<F%C=&5R("AM871C:&EN9PH@G
  852. M("`@('1H870@8VAA<F%C=&5R*2P@;W(@82!S:6YG;&4@8VAA<F%C=&5R('=I$
  853. M=&@@;F\@;W1H97(@<VEG;FEF:6-A;F-E"B`@("`@*&UA=&-H:6YG('1H870@L
  854. M8VAA<F%C=&5R*2X*"B`@("`@02!?"')?"&%?"&Y?"&=?"&4@:7,@82!S97%U$
  855. M96YC92!O9B!C:&%R86-T97)S(&5N8VQO<V5D(&EN(&!;72<N"B`@("`@270@(
  856. M;F]R;6%L;'D@;6%T8VAE<R!A;GD@<VEN9VQE(&-H87)A8W1E<B!F<F]M('1H:
  857. M92!S97%U96YC92X*("`@("!)9B!T:&4@<V5Q=65N8V4@8F5G:6YS('=I=&@@3
  858. M8%XG+`H@("`@(&ET(&UA=&-H97,@86YY('-I;F=L92!C:&%R86-T97(@7PANI
  859. M7PAO7PAT(&9R;VT@=&AE(')E<W0@;V8@=&AE('-E<75E;F-E+@H@("`@($EF:
  860. M('1W;R!C:&%R86-T97)S(&EN('1H92!S97%U96YC92!A<F4@<V5P87)A=&5D\
  861. M(&)Y(&`M)RP@=&AI<R!I<R!S:&]R=&AA;F0*("`@("!F;W(@=&AE(&9U;&P@_
  862. M;&ES="!O9B!!4T-)22!C:&%R86-T97)S(&)E='=E96X@=&AE;0H@("`@("AE)
  863. M+F<N(&!;,"TY72<@;6%T8VAE<R!A;GD@9&5C:6UA;"!D:6=I="DN"B`@("`@&
  864. M5&\@:6YC;'5D92!A(&QI=&5R86P@8%TG(&EN('1H92!S97%U96YC92P@;6%KO
  865. M92!I="!T:&4@9FER<W0@8VAA<F%C=&5R"B`@("`@*&9O;&QO=VEN9R!A('!O[
  866. M<W-I8FQE(&!>)RDN"B`@("`@5&\@:6YC;'5D92!A(&QI=&5R86P@8"TG+"!MJ
  867. M86ME(&ET('1H92!F:7)S="!O<B!L87-T(&-H87)A8W1E<BX*"D$(04T(34((Q
  868. M0DD(24<(1U4(54D(250(5%D(60H@("`@($EF(&$@<F5G=6QA<B!E>'!R97-S^
  869. M:6]N(&-O=6QD(&UA=&-H('1W;R!D:69F97)E;G0@<&%R=',@;V8@=&AE(&EN2
  870. M<'5T('-T<FEN9RP*("`@("!I="!W:6QL(&UA=&-H('1H92!O;F4@=VAI8V@@>
  871. M8F5G:6YS(&5A<FQI97-T+@H@("`@($EF(&)O=&@@8F5G:6X@:6X@=&AE('-AV
  872. M;64@<&QA8V4@("`@8G5T(&UA=&-H(&1I9F9E<F5N="!L96YG=&AS+"!O<B!M5
  873. M871C:`H@("`@('1H92!S86UE(&QE;F=T:"!I;B!D:69F97)E;G0@=V%Y<RP@Q
  874. M;&EF92!G971S(&UE<W-I97(L(&%S(&9O;&QO=W,N"@H@("`@($EN(&=E;F5R;
  875. M86PL('1H92!P;W-S:6)I;&ET:65S(&EN(&$@;&ES="!O9B!B<F%N8VAE<R!AM
  876. M<F4@8V]N<VED97)E9"!I;@H@("`@(&QE9G0M=&\M<FEG:'0@;W)D97(L('1HB
  877. M92!P;W-S:6)I;&ET:65S(&9O<B!@*B<L(&`K)RP@86YD(&`_)R!A<F4*("`@E
  878. M("!C;VYS:61E<F5D(&QO;F=E<W0M9FER<W0L(&YE<W1E9"!C;VYS=')U8W1S8
  879. M(&%R92!C;VYS:61E<F5D(&9R;VT@=&AE"B`@("`@;W5T97)M;W-T(&EN+"!A-
  880. M;F0@8V]N8V%T96YA=&5D(&-O;G-T<G5C=',@87)E(&-O;G-I9&5R960@;&5F"
  881. M=&UO<W0M9FER<W0N"B`@("`@5&AE(&UA=&-H('1H870@=VEL;"!B92!C:&]S/
  882. M96X@:7,@=&AE(&]N92!T:&%T('5S97,@=&AE(&5A<FQI97-T"B`@("`@<&]S9
  883. M<VEB:6QI='D@:6X@=&AE(&9I<G-T(&-H;VEC92!T:&%T(&AA<R!T;R!B92!MX
  884. M861E+@H@("`@($EF('1H97)E(&ES(&UO<F4@=&AA;B!O;F4@8VAO:6-E+"!TP
  885. M:&4@;F5X="!W:6QL(&)E(&UA9&4@:6X@=&AE('-A;64@;6%N;F5R"B`@("`@+
  886. M*&5A<FQI97-T('!O<W-I8FEL:71Y*2!S=6)J96-T('1O('1H92!D96-I<VEOY
  887. M;B!O;B!T:&4@9FER<W0@8VAO:6-E+@H@("`@($%N9"!S;R!F;W)T:"X*"B`@1
  888. M("`@1F]R(&5X86UP;&4L(&`H86)\82EB*F,G(&-O=6QD(&UA=&-H(&!A8F,GW
  889. M(&EN(&]N92!O9B!T=V\@=V%Y<RX*("`@("!4:&4@9FER<W0@8VAO:6-E(&EST
  890. M(&)E='=E96X@8&%B)R!A;F0@8&$G.R!S:6YC92!@86(G(&ES(&5A<FQI97(L2
  891. M(&%N9"!D;V5S"B`@("`@;&5A9"!T;R!A('-U8V-E<W-F=6P@;W9E<F%L;"!MD
  892. M871C:"P@:70@:7,@8VAO<V5N+@H@("`@(%-I;F-E('1H92!@8B<@:7,@86QRT
  893. M96%D>2!S<&]K96X@9F]R+`H@("`@('1H92!@8BHG(&UU<W0@;6%T8V@@:71S*
  894. M(&QA<W0@<&]S<VEB:6QI='DM+71H92!E;7!T>2!S=')I;F<M+7-I;F-E"B`@&
  895. M("`@:70@;75S="!R97-P96-T('1H92!E87)L:65R(&-H;VEC92X*"B`@("`@.
  896. M26X@=&AE('!A<G1I8W5L87(@8V%S92!W:&5R92!N;R!@?"=S(&%R92!P<F5SK
  897. M96YT(&%N9"!T:&5R92!I<R!O;FQY(&]N90H@("`@(&`J)RP@8"LG+"!O<B!@8
  898. M/R<L('1H92!N970@969F96-T(&ES('1H870@=&AE(&QO;F=E<W0@<&]S<VEBA
  899. M;&4*("`@("!M871C:"!W:6QL(&)E(&-H;W-E;BX*("`@("!3;R!@86(J)RP@A
  900. M<')E<V5N=&5D('=I=&@@8'AA8F)B8GDG+"!W:6QL(&UA=&-H(&!A8F)B8B<N6
  901. M"B`@("`@3F]T92!T:&%T(&EF(&!A8BHG(&ES('1R:65D(&%G86EN<W0@8'AAH
  902. M8GEA8F)B>B<L(&ET"B`@("`@=VEL;"!M871C:"!@86(G(&IU<W0@869T97(@=
  903. M8'@G+"!D=64@=&\@=&AE(&)E9VEN<RUE87)L:65S="!R=6QE+@H@("`@("A)L
  904. M;B!E9F9E8W0L('1H92!D96-I<VEO;B!O;B!W:&5R92!T;R!S=&%R="!T:&4@`
  905. M;6%T8V@@:7,@=&AE(&9I<G-T(&-H;VEC90H@("`@('1O(&)E(&UA9&4L(&AE!
  906. M;F-E('-U8G-E<75E;G0@8VAO:6-E<R!M=7-T(')E<W!E8W0@:70@979E;B!IV
  907. M9B!T:&ES(&QE861S('1H96T*("`@("!T;R!L97-S+7!R969E<G)E9"!A;'1E+
  908. M<FYA=&EV97,N*0H*4PA310A%10A%($$(04P(3%,(4T\(3PH@("`@(&5G<F5P$
  909. M*#$I+"!E>'!R*#$I"@H*"@H*1F]R;6%T=&5D(#@X+S$R+S,P("`@("`@("`@%
  910. M("`@;&]C86P@("`@("`@("`@("`@("`@("`@("`@("`@("`@(#,*#`H*"@I2.
  911. M14=%6%`H,RD@("`@("`@("`@("`@("`@3&EB<F%R>2!&=6YC=&EO;G,@("`@K
  912. M("`@("`@("`@("!214=%6%`H,RD*"@H*1`A$20A)00A!1PA'3@A.3PA/4PA39
  913. M5`A420A)0PA#4PA3"B`@("`@7PA27PAE7PAG7PAC7PAO7PAM7PAP(')E='5R@
  914. M;G,@3E5,3"!F;W(@82!F86EL=7)E"B`@("`@*%\(<E\(95\(9U\(95\(<E\(]
  915. M<E\(;U\(<B!P97)M:71T:6YG*2P*("`@("!W:&5R92!F86EL=7)E<R!A<F4@1
  916. M<WEN=&%X(&5R<F]R<RP@97AC965D:6YG(&EM<&QE;65N=&%T:6]N(&QI;6ETA
  917. M<RP*("`@("!O<B!A<'!L>6EN9R!@*R<@;W(@8"HG('1O(&$@<&]S<VEB;'DM8
  918. M;G5L;"!O<&5R86YD+@H*2`A(20A)4PA35`A43PA/4@A260A9"B`@("`@0F]TQ
  919. M:"!C;V1E(&%N9"!M86YU86P@<&%G92!W97)E"B`@("`@=W)I='1E;B!A="!5%
  920. M(&]F(%0N"B`@("`@5&AE>2!A<F4@:6YT96YD960@=&\@8F4@8V]M<&%T:6)LC
  921. M92!W:71H('1H92!"96QL(%8X(%\(<E\(95\(9U\(95\(>%\(<"@S*2P*("`@>
  922. M("!B=70@87)E(&YO="!D97)I=F5D(&9R;VT@0F5L;"!C;V1E+@H*0@A"50A5%
  923. M1PA'4PA3"B`@("`@16UP='D@8G)A;F-H97,@86YD(&5M<'1Y(')E9W5L87(@W
  924. M97AP<F5S<VEO;G,@87)E(&YO="!P;W)T86)L92!T;R!6."X*"B`@("`@5&AEY
  925. M(')E<W1R:6-T:6]N(&%G86EN<W0*("`@("!A<'!L>6EN9R!@*B<@;W(@8"LG/
  926. M('1O(&$@<&]S<VEB;'DM;G5L;"!O<&5R86YD(&ES(&%N(&%R=&EF86-T(&]F8
  927. M('1H90H@("`@('-I;7!L:7-T:6,@:6UP;&5M96YT871I;VXN"@H@("`@($1OG
  928. M97,@;F]T('-U<'!O<G0@7PAE7PAG7PAR7PAE7PAP)W,@;F5W;&EN92US97!A^
  929. M<F%T960@8G)A;F-H97,["B`@("`@;F5I=&AE<B!D;V5S('1H92!6."!?"')?\
  930. M"&5?"&=?"&5?"'A?"'`H,RDL('1H;W5G:"X*"B`@("`@1'5E('1O(&5M<&AA*
  931. M<VES(&]N"B`@("`@8V]M<&%C=&YE<W,@86YD('-I;7!L:6-I='DL"B`@("`@F
  932. M:70G<R!N;W0@<W1R:6MI;F=L>2!F87-T+@H@("`@($ET(&1O97,@9VEV92!SD
  933. M<&5C:6%L(&%T=&5N=&EO;B!T;R!H86YD;&EN9R!S:6UP;&4@8V%S97,@<75I4
  934. M8VML>2X*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@I&;W)M871T960@3
  935. M.#@O,3(O,S`@("`@("`@("`@("!L;V-A;"`@("`@("`@("`@("`@("`@("`@?
  936. +("`@("`@("`@-`H@^
  937. ``
  938. end
  939. size 8651
  940. SHAR_EOF
  941. cat << \SHAR_EOF > stevie.doc
  942.  
  943.         STEVIE - Simply Try this Editor for VI Enthusiasts
  944.  
  945.              Quick Reference Card
  946.  
  947.                   by
  948.  
  949.               Tony Andrews And G. R. (Fred) Walter
  950.  
  951. STEVIE may be freely distributed. The source isn't copyrighted or
  952. restricted in any way. If you pass the program along, please include all
  953. the documentation and, if practical, the source as well.
  954.  
  955. STEVIE used to stand for 'ST Editor for VI Enthusiasts', however since this
  956. editor is used on more machines than just ST's the acronym was changed.
  957.  
  958. Starting the Editor
  959. -------------------
  960.  
  961. The following command line forms are supported:
  962.  
  963.     vi [file ...]        Edit the specified file(s)
  964.  
  965.     vi -t tag        Start at location of the given tag
  966.  
  967.     vi + file        Edit file starting at end
  968.  
  969.     vi +n file        Edit file starting a line number 'n'
  970.  
  971.     vi +/pat file        Edit file starting at pattern 'pat'
  972.  
  973. If multiple files are given on the command line (using the first form),
  974. the ":n" command goes to the next file, ":p" goes backward in the list,
  975. and ":rew" can be used to rewind back to the start of the file list.
  976.  
  977. Set Command Options
  978. -------------------
  979.  
  980. The ":set" command works as usual to set parameters. Each parameter has
  981. a long and an abbreviated name, either of which may be used. Boolean
  982. parameters are set as in:
  983.  
  984.     set showmatch
  985.  
  986. or cleared by:
  987.  
  988.     set noshowmatch
  989.  
  990. Numeric parameters are set as in:
  991.  
  992.     set scroll=5
  993.  
  994. Several parameters may be set with a single command:
  995.  
  996.     set novb sm report=1
  997.  
  998. To see the status of all parameters use ":set all". Typing ":set" with
  999. no arguments will show only those parameters that have been changed.
  1000. The supported parameters, their names, defaults, and descriptions are
  1001. shown below:
  1002.  
  1003. Full Name    Short    Default        Description
  1004. ------------------------------------------------------------------------------
  1005. vbell        vb    vb        Use visual bell (novb for audible bell)
  1006. showmatch    sm    nosm        Showmatch mode
  1007. wrapscan    ws    ws        Wrapscan (searches cross file start/end)
  1008. errorbells    eb    noeb        Ring bell when error messages are shown
  1009. showmode    mo    nomo        Show on status line when in insert mode
  1010. backup        bk    nobk        Leave backup in *.bak on file writes
  1011. return        cr    cr        End lines with cr-lf when writing
  1012. list        list    nolist        Show tabs and newlines graphically
  1013. autoindent      ai      noai            Start new line at same col as prior line
  1014. ignorecase      ic      noic            Ignore case in search strings
  1015. number          nu      nonu            Display lines with their line numbers
  1016.  
  1017. scroll        scroll    12        Number of lines to scroll for ^D and ^U
  1018. tabstop        ts    8        Number of spaces in a tab
  1019. report        report    5        Min # of lines to report operations on
  1020. lines        lines    25        Number of lines on the screen
  1021.  
  1022. The EXINIT environment variable can be used to modify the default values
  1023. on startup as in:
  1024.  
  1025.         setenv EXINIT="set sm ts=4"
  1026.  
  1027. The 'backup' parameter, if set, causes the editor to retain a backup of any
  1028. files that are written. During file writes, a backup is always kept for
  1029. safety until the write is completed. At that point, the 'backup' parameter
  1030. determines whether the backup file is deleted.
  1031.  
  1032. In environments (e.g. OS/2 or TOS) where lines are normally terminated by
  1033. CR-LF, the 'return' parameter allows files to be written with only a LF
  1034. terminator (if the parameter is cleared).
  1035.  
  1036. The 'lines' parameter tells the editor how many lines there are on the screen.
  1037. This is useful on systems like the ST where various screen resolutions may be
  1038. used. By using the 'lines' parameter, different screen sizes can be easily
  1039. handled. On the Amiga system window resizes are atomatically detected and
  1040. acted upon. It is suggested that one's window be larger than 2 rows and 5
  1041. columns.
  1042.  
  1043. Colon Commands
  1044. --------------
  1045.  
  1046. Several of the normal 'vi' colon commands are supported by STEVIE. Some commands
  1047. may be preceded by a line range specification. For commands that accept a range
  1048. of lines, the following address forms are supported:
  1049.  
  1050. addr
  1051. addr + number
  1052. addr - number
  1053.  
  1054. where 'addr' may be one of the following:
  1055.     a line number
  1056.     a mark (as in 'a or 'b)
  1057.     % (entire file)
  1058.     . (the current line)
  1059.     $ (the last line)
  1060.  
  1061. The Global Command
  1062. ------------------
  1063.  
  1064. A limited form of the global command is supported, accepting the following
  1065. command form:
  1066.  
  1067. g/pattern/X
  1068.  
  1069. where X may be either 'd' or 'p' to delete or print lines that match the given
  1070. pattern. If a line range is given, only those lines are checked for a match
  1071. with the pattern. If no range is given, all lines are checked.
  1072.  
  1073. If the trailing command character is omitted, 'p' is assumed. In this case, the
  1074. trailing slash is also optional. The current version of the editor does not
  1075. support the undo operation following the deletion of lines with the global
  1076. command.
  1077.  
  1078. The Substitute Command
  1079. ----------------------
  1080.  
  1081. The substitute command provides a powerful mechanism for making more complex
  1082. substitutions than can be done directly from visual mode. The general form of
  1083. the command is:
  1084.  
  1085. s/pattern/replacement/g
  1086.  
  1087. Each line in the given range (or the current line, if no range was given) is
  1088. scanned for the given regular expression. When found, the string that matched
  1089. the pattern is replaced with the given replacement string. If the replacement
  1090. string is null, each matching pattern string is deleted.
  1091.  
  1092. The trailing 'g' is optional and, if present, indicates that multiple
  1093. occurrences of 'pattern' on a line should all be replaced.
  1094.  
  1095. Some special sequences are recognized in the replacement string. The
  1096. ampersand character is replaced by the entire pattern that was matched.
  1097. For example, the following command could be used to put all occurrences
  1098. of 'foo' or 'bar' within double quotes:
  1099.  
  1100. 1,$s/foo|bar/&/g
  1101.  
  1102. The special sequence "\n" where 'n' is a digit from 1 to 9, is replaced
  1103. by the string the matched the corresponding parenthesized expression in
  1104. the pattern. The following command could be used to swap the first two
  1105. parameters in calls to the C function "foo":
  1106.  
  1107. 1,$s/foo\\(([^,]*),([^,]*),/foo(\\2,\\1,/g
  1108.  
  1109. Like the global command, substitutions can't be undone with this version of
  1110. the editor.
  1111.  
  1112. The Delete Command
  1113. ------------------
  1114.  
  1115. :[range]d will delete the range of lines.
  1116.  
  1117. File Manipulation Commands
  1118. --------------------------
  1119.  
  1120. :w        write the current file
  1121. :wq        write and quit
  1122. :x        write (if necessary) and quit
  1123. ZZ        same as ":x"
  1124.  
  1125. :e file        edit the named file
  1126. :e!        re-edit the current file, discarding any changes
  1127. :e #        edit the alternate file
  1128.  
  1129. :w file        write the buffer to the named file
  1130. :x,y w file    write lines x through y to the named file
  1131. :r file        read the named file into the buffer
  1132.  
  1133. :n        edit the next file
  1134. :p        edit the previous file
  1135. :rew        rewind the file list
  1136.  
  1137. :f        show the current file name
  1138. :f name        change the current file name
  1139.  
  1140. :ta tag        go to the named tag
  1141. ^]        like ":ta" using the current word as the tag
  1142.  
  1143. :help        display a command summary
  1144.  
  1145. The ":help" command can also be invoke with the <HELP> key on the Atari ST
  1146. or the Amiga. This actually displays a pretty complete summary of the real vi
  1147. with unsupported features indicated appropriately.
  1148.  
  1149. The commands above work pretty much like they do in 'vi'. Most of the
  1150. commands support a '!' suffix (if appropriate) to discard any pending
  1151. changes.
  1152.  
  1153. String Searches
  1154. ---------------
  1155.  
  1156. String searches are supported, as in vi, accepting the usual regular
  1157. expression syntax. This was done using Henry Spencer's regular expression
  1158. library without modification. Tony Andrews added code outside the library to
  1159. support the '\<' and '\>' extensions and code inside the library to support
  1160. the ignorecase option.
  1161.  
  1162. Operators
  1163. ---------
  1164.  
  1165. The vi operators (d, c, y, <, and >) work as true operators.
  1166.  
  1167. Tags
  1168. ----
  1169.  
  1170. Tags are implemented.
  1171.  
  1172. System-Specific Comments
  1173. ------------------------
  1174.  
  1175. The following sections provide additional relevant information for the
  1176. systems to which STEVIE has been ported.
  1177.  
  1178. Atari ST
  1179. --------
  1180.  
  1181. The editor has been tested in all three resolutions, although low and
  1182. high res. are less tested than medium. The 50-line high res. mode can
  1183. be used by setting the 'lines' parameter to 50. Alternatively, the
  1184. environment variable 'LINES' can be set. The editor doesn't actively
  1185. set the number of lines on the screen. It just operates using the number
  1186. of lines it was told.
  1187.  
  1188. The arrow keys, as well as the <INSERT>, <HELP>, and <UNDO> keys are
  1189. all mapped appropriately.
  1190.  
  1191. UNIX
  1192. ----
  1193.  
  1194. The editor has been ported to UNIX System V release 3. This was done
  1195. mainly to get some profiling data so I haven't put much effort into
  1196. doing the UNIX version right. It's hard-coded for ansi-style escape
  1197. sequences and doesn't use the termcap/terminfo routines at all.
  1198.  
  1199. OS/2
  1200. ----
  1201.  
  1202. This port was done because the editor that comes with the OS/2 developer's
  1203. kit really sucks. Make sure 'ansi' mode is on (using the 'ansi' command).
  1204. The OS/2 console driver doesn't support insert/delete line, so STEVIE
  1205. bypasses the driver and makes the appropriate system calls directly.
  1206. This is all done in the system-specific part of the editor so the kludge
  1207. is at least localized.
  1208.  
  1209. The arrow keys, page up/down and home/end all do what you'd expect. The function
  1210. keys are hard-coded to some useful macros until I can get true support for
  1211. macros into the editor. The current mappings are:
  1212.  
  1213. F1    :p <RETURN>
  1214. F2    :n <RETURN>
  1215. F3    :e # <RETURN>
  1216. F4    :rew <RETURN>
  1217. F5    [[
  1218. F6    ]]
  1219. F7    <<
  1220. F8    >>
  1221. F9    :x <RETURN>
  1222. F10    :help <RETURN>
  1223.  
  1224. S-F1    :p! <RETURN>
  1225. S-F2    :n! <RETURN>
  1226.  
  1227. MSDOS
  1228. -----
  1229.  
  1230. STEVIE has been ported to MSDOS 3.3 on an AT using the Microsoft C compiler,
  1231. version 5.10.  The keyboard mappings are the same as for OS/2.
  1232. The only problem with the PC version is that the inefficiency of
  1233. the screen update code becomes painfully apparent on slower machines.
  1234.  
  1235. BSD 4.3
  1236. -------
  1237.  
  1238. This port was done so it could be worked on in a main-frame enviroment.
  1239.  
  1240. Amiga
  1241. -----
  1242.  
  1243. The arrow keys and the help key are supported, as is window re-sizing.
  1244. It is strongly suggested that you not try to type in console commands
  1245. (alt-esc in some keymaps, plus the appropriate other keys) since STEVIE
  1246. captures all console input. If you do type alt-esc then typing '|' will
  1247. return you to STEVIE.
  1248.  
  1249. Missing Features
  1250. ----------------
  1251.  
  1252. 1. Macros with support for function keys.
  1253.  
  1254. 2. More "set" options.
  1255.  
  1256. 3. Many others...
  1257.  
  1258. Known Bugs and Problems
  1259. -----------------------
  1260.  
  1261. 1. The yank buffer uses statically allocated memory, so yanks of more than
  1262.    5K of text will fail. If a delete spans more than 5K, the program asks
  1263.    for confirmation before proceeding. That way, if you were moving text,
  1264.    you don't get screwed by the limited yank buffer. You just have to move
  1265.    smaller chunks at a time. All the internal buffers (yank, redo, etc.)
  1266.    need to be reworked to allocate memory dynamically.
  1267.  
  1268. 2. If you stay in insert mode for a long time (around 5K's worth of
  1269.    characters, including newlines) the insert buffer can overflow.
  1270.    When this happens you lose your ability to automatically undo the text just
  1271.    inserted and the redo/undo/(undo of undo) buffers are reset to the
  1272.    current position.
  1273.  
  1274. 3. Several other less bothersome glitches...
  1275.  
  1276. Character Function Summary
  1277. --------------------------
  1278.  
  1279. The following list describes the meaning of each character that's used
  1280. by the editor. In some cases characters have meaning in both command and
  1281. insert mode; these are all described.
  1282.  
  1283. ^@    The null character. Not used in any mode. This character may not
  1284.     be present in the file, as is the case with vi.
  1285.  
  1286. ^B    Backward one screen.
  1287.  
  1288. ^D    Scroll the window down one half screen.
  1289.  
  1290. ^E    Scroll the screen up one line.
  1291.  
  1292. ^F    Forward one screen.
  1293.  
  1294. ^G    Same as ":f" command. Displays file information.
  1295.  
  1296. ^H (BS)    Moves cursor left one space in command mode. In insert mode, erases
  1297.     the last character typed.
  1298.  
  1299. ^J    Move the cursor down one line.
  1300.  
  1301. ^L    Clear and redraw the screen.
  1302.  
  1303. ^M (CR)    Move to the first non-white character in the next line. In insert
  1304.     mode, a carriage return opens a new line for input.
  1305.  
  1306. ^N    Move the cursor down a line.
  1307.  
  1308. ^P    Move the cursor up a line.
  1309.  
  1310. ^U    Scroll the window up one half screen.
  1311.  
  1312. ^V    Indicates that the next character is should be treated as entered
  1313.     and not modified (used to enter control characters, etc.).
  1314.  
  1315. ^Y    Scroll the screen down one line.
  1316.  
  1317. ^[    Escape cancels a pending command in command mode, and is used to
  1318.     terminate insert mode.
  1319.  
  1320. ^]    Moves to the tag whose name is given by the word in which the cursor
  1321.     resides.
  1322.  
  1323. ^`    Same as ":e #" if supported (system-dependent).
  1324.  
  1325. SPACE    Move the cursor right on column.
  1326.  
  1327. $    Move to the end of the current line.
  1328.  
  1329. %    If the cursor rests on a paren '()', brace '{}', or bracket '[]',
  1330.     move to the matching one.
  1331.  
  1332. '    Used to move the cursor to a previously marked position, as in
  1333.     'a or 'b. The cursor moves to the start of the marked line. The
  1334.     special mark '' refers to the "previous context".
  1335.  
  1336. +    Same as carriage return, in command mode.
  1337.  
  1338. ,    Reverse of the last t, T, f, or F command.
  1339.  
  1340. -    Move to the first non-white character in the previous line.
  1341.  
  1342. .    Repeat the last edit command.
  1343.  
  1344. /    Start of a forward string search command. String searches may be
  1345.     optionally terminated with a closing slash. To search for a slash
  1346.     use '\/' in the search string.
  1347.  
  1348. 0    Move to the start of the current line. Also used within counts.
  1349.  
  1350. 1-9    Used to add 'count' prefixes to commands.
  1351.  
  1352. :    Prefix character for "ex" commands.
  1353.  
  1354. ;    Repeat last t, T, f, or F command.
  1355.  
  1356. <    The 'left shift' operator.
  1357.  
  1358. >    The 'right shift' operator.
  1359.  
  1360. ?    Same as '/', but search backward.
  1361.  
  1362. A    Append at the end of the current line.
  1363.  
  1364. B    Backward one blank-delimited word.
  1365.  
  1366. C    Change the rest of the current line.
  1367.  
  1368. D    Delete the rest of the current line.
  1369.  
  1370. E    End of the end of a blank-delimited word.
  1371.  
  1372. F    Find a character backward on the current line.
  1373.  
  1374. G    Go to the given line number (end of file, by default).
  1375.  
  1376. H    Move to the first non-white char. on the top screen line.
  1377.  
  1378. I    Insert before the first non-white char. on the current line.
  1379.  
  1380. J    Join two lines.
  1381.  
  1382. L    Move to the first non-white char. on the bottom screen line.
  1383.  
  1384. M    Move to the first non-white char. on the middle screen line.
  1385.  
  1386. N    Reverse the last string search.
  1387.  
  1388. O    Open a new line above the current line, and start inserting.
  1389.  
  1390. P    Put the yank/delete buffer before the current cursor position.
  1391.  
  1392. T    Reverse search 'upto' the given character.
  1393.  
  1394. W    Move forward one blank-delimited word.
  1395.  
  1396. X    Delete one character before the cursor.
  1397.  
  1398. Y    Yank the current line. Same as 'yy'.
  1399.  
  1400. ZZ    Exit from the editor, saving changes if necessary.
  1401.  
  1402. [[    Move backward one C function.
  1403.  
  1404. ]]    Move forward one C function.
  1405.  
  1406. ^    Move to the first non-white on the current line.
  1407.  
  1408. `    Move to the given mark, as with '. The distinction between the two
  1409.     commands is important when used with operators. I support the
  1410.     difference correctly. If you don't know what I'm talking about,
  1411.     don't worry, it won't matter to you.
  1412.  
  1413. ~       Switch case of character under cursor.
  1414.  
  1415. a    Append text after the cursor.
  1416.  
  1417. b    Back one word.
  1418.  
  1419. c    The change operator.
  1420.  
  1421. d    The delete operator.
  1422.  
  1423. e    Move to the end of a word.
  1424.  
  1425. f    Find a character on the current line.
  1426.  
  1427. h    Move left one column.
  1428.  
  1429. i    Insert text before the cursor.
  1430.  
  1431. j    Move down one line.
  1432.  
  1433. k    Move up one line.
  1434.  
  1435. l    Move right one column.
  1436.  
  1437. m    Set a mark at the current position (e.g. ma or mb).
  1438.  
  1439. n    Repeat the last string search.
  1440.  
  1441. o    Open a new line and start inserting text.
  1442.  
  1443. p    Put the yank/delete buffer after the cursor.
  1444.  
  1445. r    Replace a character.
  1446.  
  1447. s    Replace characters.
  1448.  
  1449. t    Move forward 'upto' the given character on the current line.
  1450.  
  1451. u    Undo the last edit.
  1452.  
  1453. w    Move forward one word.
  1454.  
  1455. x    Delete the character under the cursor.
  1456.  
  1457. y    The yank operator.
  1458.  
  1459. z    Redraw the screen with the current line at the top (zRETURN),
  1460.     the middle (z.), or the bottom (z-).
  1461.  
  1462. |    Move to the column given by the preceding count.
  1463. SHAR_EOF
  1464. #    End of shell archive
  1465. exit 0
  1466. -- 
  1467. Bob Page, U of Lowell CS Dept.  page@swan.ulowell.edu  ulowell!page
  1468. Have five nice days.
  1469.